<?php

namespace MLM\Model;

use MLM\Model\Generic\Object\Map;
use MLM\Model\Generic\Object\Mapper;

class Notification extends Mapper {

    protected $_storage;
    
    public function __construct(\MLM\Model\Notification\Storage $storage) {

        $this->_storage = $storage;
        
        //parent::__construct($data, $map);
    }
    
    public function getCountNewMsg($memberId) {

        $result = $this->_storage->getCountNewMsg($memberId);

        while($result->next()){
            $res = $result->current();
            $numNewMsg = $res['num'];

        }     

        return $numNewMsg;
    }

    public function getNewMsgList($memberId) {

        return $this->_storage->getNewMsgList($memberId);

    }

    public function getCountAlertApproval($memberTypeId, $memberId) {

        /*
        $result = $this->_storage->getCountAlertApproval($memberTypeId, $memberId);
        while($result->next()){
            $res = $result->current();
            $numNewAlert = $res['num'];
        }

        return $numNewAlert;*/

        return 0;
    }

    public function getAlertApproval($memberTypeId, $memberId) {

        //return $this->_storage->getAlertApproval($memberTypeId, $memberId);

        return;

    }

    
}
